<div class="order-list-page" ng-if="pagedata.op == 'list'">
    <div class="fui-header">
		<div class="fui-header-left" ng-click="goback()">
            <a class="back"></a>
        </div>
		<div class="title">我的对话</div>
		<div class="fui-header-right"></div>
	</div>
	<div id="tab" class="fui-tab fui-tab-danger">
        <a ng-class="{'external active':pagedata.params.status ==100}" href="javascript:" ng-click="pagedata.params.status=100;tool.get_list('jy_aikefu/mytcp/list/',true);">全部</a>
        <a ng-class="{'external active':pagedata.params.status == 0}" href="javascript:" ng-click="pagedata.params.status=0;tool.get_list('jy_aikefu/mytcp/list/',true);">待咨询</a>
        <a ng-class="{'external active':pagedata.params.status == 1}" href="javascript:" ng-click="pagedata.params.status=1;tool.get_list('jy_aikefu/mytcp/list/',true);">咨询中</a>
        <a ng-class="{'external active':pagedata.params.status == 3}" href="javascript:" ng-click="pagedata.params.status=3;tool.get_list('jy_aikefu/mytcp/list/',true);">已结束</a>
    </div>
	<div class='fui-content order-list' style="margin-top:4.5rem">
	<div class="fui-list-group order-item" ng-repeat="item in pagedata.list">
                <div class="fui-list external" style="padding: 0.42rem 0.5rem" data-nocache="true">
                    <div class="fui-list-inner">
                        <div class="subtitle"> 对话号: {{item.ordersn}}</div>
                    </div>
                    <div class="row-remark text-cancel" style="font-size: 0.65rem;text-align: right;">{{item.statustitle}}</div>
                    <div class="angle"></div>
                </div>
				<div style="padding:0 0.5rem">
			     <div class="fui-cell-group" style="padding:0.5rem;border-radius:0.5rem;border: 1px solid #eee;background:#f6faf9">
								<div class="fui-cell" style="padding:0">
									<div class="fui-cell-label" style="width:2.3rem;">
										<img style="border-radius: 50%;width:2rem;height:2rem" ng-src="{{tomedia(item.worker.logo) || '../addons/jy_aikefu/resource/images/avatar.png'}}" />
									</div>
									<div class="fui-cell-info" style="font-size:0.7rem;">
										<div class="bold">{{item.worker.title}}</div>
										<div class="subtitle" style="font-size:0.6rem">{{item.worker.api_data.jidesc||item.worker.subtitle}}</div>
										<div style="padding:0.3rem 0;font-size:0.6rem">
											<span class="bold syscolor"><i class="icon icon-shoucang-tianchong" style="font-size:0.6rem"></i> {{item.worker.star || '5.0'}}</span>
											<i class="icon icon-zuoshuangxiexian" style="color:#f2f2f2"></i>
											<span class="gray">咨询量 <span class="bold syscolor">{{item.worker.salenum}}</span></span>
											<i class="icon icon-zuoshuangxiexian" style="color:#f2f2f2"></i>
											<span class="gray">平均响应 <span class="bold syscolor">{{item.worker.api_data.uptime || '1小时'}}</span></span>
										</div>
										<div style="position: relative;width:100%;overflow-y: hidden;">
										<div class="fui-tab-scroll" style="height: auto">
											 <a ng-repeat="t in item.worker.tags" class="btn btn-default btn-sm"> {{t.title}} </a>
										</div>
										</div>
									</div>
								</div>		
				</div>
				</div>
				<div class="title" style="padding:0.2rem 0.5rem">
						<div ng-if="item.grouptitle"><i class="icon icon-f13" style="font-size: 0.65rem"> 类型：<span class="price red">{{item.grouptitle}}</span></i></div>
						<div><i class="icon icon-shijian" style="font-size: 0.65rem"> 时间：{{item.createtime}}</i></div>
				</div>
				<div class="fui-list-group-title lineblock opblock">
					<span class="status noremark">
						<div ng-show="item.status == 0" class="btn btn-sm btn-default-o order-delete" href="javascript:" ng-click="post({},'del','id='+item.id)">删除对话</div>
						<div ng-show="item.status == 1 || item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="access_json('/tcplog//id='+item.id)">前往咨询</div>
						<div ng-show="item.status == 3 && item.status >4" class="btn btn-sm btn-default-o order-finish" href="javascript:" ng-click="access_json('/tcplog//id='+item.id)">查看咨询</div>
						<div ng-show="item.ispay == 0 && item.status == 0" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="pagedata.pay(item.id)">支付对话</div>
						<div ng-show="item.status == 2" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="post({},'receive','id='+item.id,'','确定已经完成本次咨询了？')">完成咨询</div>
						<div ng-show="item.status == 3" class="btn btn-sm btn-danger-o order-finish" href="javascript:" ng-click="access_json('/comment/commentorder/id='+item.id)">评价</div>
					</span>
				</div>
        </div>
	</div>
	<div class="content-empty" ng-show="pagedata.list.length == 0 ">
		  <i class="icon jinyunicon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">您暂时没有订单！</p>
	</div>
</div>
<div ng-include="sys_html('common/pluginnav',true)"></div>
<script type="text/javascript">
scope.tool.get_list('jy_aikefu/mytcp/list/',true);
scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_aikefu/mytcp/list/');
}
scope.pagedata.pay=function(id){
	scope.post_json('jy_aikefu/mytcp/pay/',{'id':id},function(pay_id){
		scope.$evalAsync();
		scope.tool.pay(pay_id,function(res){
				if(res.type=='success'){
					scope.message('支付成功！','success','jy_aikefu/mytcp/');
				}else{
					scope.message('支付失败！','success','jy_aikefu/mytcp/');
				}
		});
	});
}
scope.pagedata.paynew=function(id){
	scope.post_json('jy_aikefu/mytcp/paynew/',{'id':id},function(pay_id){
		scope.$evalAsync();
		scope.tool.pay(pay_id,function(res){
				if(res.type=='success'){
					scope.message('支付成功！','success','jy_aikefu/mytcp/');
				}else{
					scope.message('支付失败！','success','jy_aikefu/mytcp/');
				}
		});
	});
}
</script>